<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue (2).js"></script>
</head>

<body>
    <div id="app">
        <form action="">
            <p>
                用户姓名: <input type="text" name="username" :value="username">
            </p>
            <p>
                个人简介: <textarea type="text" col="30" rows="10" v-model="introCity"></textarea>
            </p>
            <p>
                性别: <input type="radio" name="sex" value="nan" v-model="sex">男
                性别: <input type="radio" name="sex" value="girl" v-model="sex">女
            </p>
            <p>
                运动:
                <input type="checkbox" name="sports" value="蓝求" v-model="sports">篮球
                <input type="checkbox" name="sports" value="足球" v-model="sports">足球
                <input type="checkbox" name="sports" value="乒乓球" v-model="sports">乒乓球
            </p>
            <p>
                收获地址:
                <select name="" id="" v-model="city">
                    <option value="1">北京市</option>
                    <option value="2">上海市</option>
                    <option value="3">广州市</option>
                    <option value="4">深圳市</option>
                </select>
            </p>
            <p>性别:{{sex}}</p>
            <p>性别:{{sports}}</p>
            <p>性别:{{city}}</p>
            <button @click="submit">提交</button>
        </form>
    </div>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
                username: "lily",
                sex: "girl",
                introCity: "北京市",
                sports: ["篮球"],
                city: 4
            },
            methods: {
                submit: function () {
                    console.log(1111111111);
                    alert(`我叫${this.username},我来自${this.introCity}喜欢的运动${this.sports},目前居住在${this.city}`)
                }
            }
        })
    </script>
</body>

</html>